package com.qingzhuge.member.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.qingzhuge.entity.BasePkLongEntity;
import com.qingzhuge.verification.enums.EnumCloudType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;

/**
 * @author : zero.xiao
 * @description :
 * @date : 2018/9/29 0029 下午 16:31
 * @modified :
 * @since :
 */
@ApiModel("A实人认证")
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "sys_member_verification")
public class SysMemberVerification extends BasePkLongEntity {
    private static final long serialVersionUID = 8549015516060354057L;
    @JSONField(serialize = false)
    private EnumCloudType type;
    private Long userId;
    @ApiModelProperty("身份证号")
    @JSONField(serialize = false)
    @Column(length = 18)
    private String idNumber;
    /**
     * ali 认证服务返回:-1 未认证, 0 认证中, 1 认证通过, 2 认证不通过
     */
    @ApiModelProperty("认证状态码:-1 未认证, 0 认证中, 1 认证通过, 2 认证不通过")
    private Integer statusCode;
    /**
     * 认证状态:true = 通过\false = 不通过
     */
    @ApiModelProperty("认证状态:true = 通过\\false = 不通过")
    private Boolean status;
    @JSONField(serialize = false)
    private String token;
    @JSONField(serialize = false)
    private String ticketId;
    @JSONField(serialize = false)
    private String identificationNumber;
    @JSONField(serialize = false)
    private String idCardType;
    @JSONField(serialize = false)
    private String idCardStartDate;
    @JSONField(serialize = false)
    private String idCardExpiry;
    @JSONField(serialize = false)
    private String address;
    @JSONField(serialize = false)
    private String sex;
    @JSONField(serialize = false)
    private String ethnicGroup;
    private String h5page;

    public SysMemberVerification() {
    }

    public SysMemberVerification(EnumCloudType type, String name, String idNumber) {
        super(name);
        this.idNumber = idNumber;
        this.type = type;
    }

    @JSONField(serialize = false)
    @Override
    public String getName() {
        return super.getName();
    }

    @JSONField(serialize = false)
    @Override
    public void setName(String name) {
        super.setName(name);
    }
}
